#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <string>

using namespace std;

int main()
{
    map<string, size_t> word_count = {{"hello", 1}, {"world", 2}};
    string removal_word = "hello";
    // 删除一个关键字，返回删除的元素数量
    if (word_count.erase(removal_word))
        cout << "ok: " << removal_word << " removed\n";
    else
        cout << "oops: " << removal_word << " not found!\n";

    multimap<string, string> authors{{"Barth, John", "Sot-Weed Factor"},
                                    {"Barth, John", "Lost in the Funhouse"}};
    auto cnt = authors.erase("Barth, John");
    cout << cnt << endl;
}